//
//  MyCollectionCell.m
//  HuiKaoClient
//
//  Created by 龚 杰 on 13-2-28.
//  Copyright (c) 2013年 龚 杰. All rights reserved.
//

#import "MyCollectionCell.h"

@implementation MyCollectionCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        m_titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15,8,290,20)];
        m_titlelabel.backgroundColor = [UIColor clearColor];
        m_titlelabel.font = [UIFont boldSystemFontOfSize:16.0f];
        m_titlelabel.textColor = [UIColor blackColor];
        [self.contentView addSubview:m_titlelabel];
        
        m_timelabel =[[UILabel alloc] initWithFrame:CGRectMake(15,33,200,20)];
        m_timelabel.backgroundColor = [UIColor clearColor];
        m_timelabel.font = [UIFont boldSystemFontOfSize:12.0f];
        m_timelabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:m_timelabel];
        
        m_asynImage = [[AsyncImageView alloc] initWithFrame:CGRectMake(253, 5, 60, 47)];
        m_asynImage.backgroundColor = [UIColor blackColor];
      
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setIsImageAndtext:(NSString*)url title:(NSString*)_title time:(NSString*)_time
{
    if (url!=nil&&url.length>0) {
        [self.contentView addSubview:m_asynImage];
        if (url.length>0) {
            m_asynImage._imageRequestURL = url;
            m_asynImage.m_BoolSetImage = YES;
            [m_asynImage customLoadImageFromURL];
        }
        m_titlelabel.frame = CGRectMake(15,8,240,20);
    }
    if (_title.length >0) {
        m_titlelabel.text = _title;
    }
    if (_time.length>0) {
        m_timelabel.text = _time;
    }
}
- (void)dealloc
{
    [m_titlelabel release];
    [m_timelabel release];
    [m_asynImage release];
    [super dealloc];
}
@end
